﻿	         var _menus = {"menus":[
			            {"menuid":"1","icon":"icon-sys","menuname":"Table",
							"menus":[
								{"menuname":"Who Was","icon":"icon-nav","url":"ip_ft.php"},
                                {"menuname":"Search History DB","icon":"icon-nav","url":"db_ft.php"}
								
								    
								]
						},
						{"menuid":"8","icon":"icon-sys","menuname":"Chart",
							"menus":[{"menuname":"Stats by Day","icon":"icon-nav","url":"overview_ft.php"},
									{"menuname":"Stats Compare","icon":"icon-nav","url":"chart_global_ft.php"},			
								    {"menuname":"Malicious Web Active Time","icon":"icon-nav","url":"chart_phish_ft.php"},
								]
						},

					   {"menuid":"28","icon":"icon-sys","menuname":"System Manage",
							"menus":[
									{"menuname":"test","icon":"icon-nav","url":"test.php"}
								]
						}
				]};		


        

        //修改密码
        function serverLogin() {
            var $newpass = $('#txtNewPass');
            var $rePass = $('#txtRePass');
               
            if ($newpass.val() == '') {
                msgShow('系统提示', '请输入密码！', 'warning');
                return false;
            }
            if ($rePass.val() == '') {
                msgShow('系统提示', '请在一次输入密码！', 'warning');
                return false;
            }

            if ($newpass.val() != $rePass.val()) {
                msgShow('系统提示', '两次密码不一至！请重新输入', 'warning');
                return false;
            }
        var r1=/[a-zA-Z_][a-zA-Z_0-9]{0,}/;
        var r2=/^[A-Za-z]+$/;
        if(r1.test($newpass.val())&&!(r2.test($newpass.val()))&&($newpass.val().length>=5&&$newpass.val().length<=15)){
                $.post('changepsw.php?newpass=' + $newpass.val(), function(msg) {

                msgShow(msg, 'info');
                $newpass.val('');
                $rePass.val('');
                close();
            })

            }
        else{

             msgShow('系统提示', '请输入正确密码（字母或下划线开头，必须为字母数字组合,5-15字符）！', 'warning');
             return false;

            }
            
        }

        $(function() {

            openPwd();
            //
            $('#editpass').click(function() {
                $('#w').window('open');
            });

            $('#btnEp').click(function() {
                serverLogin();
            })

			$('#btnCancel').click(function(){closePwd();})

           

            $('#loginOut').click(function() {
                $.messager.confirm('系统提示', '您确定要退出本次登录吗?', function(r) {

                    if (r) {
                        location.href = 'exit.php';
                    }
                });

            })
			
			
			
        });
		
		$(function(){
			setTimeout(function(){
				$('body').layout('collapse','east');
			},0);
		});
